/**
 * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package com.crossriver.crgis.database.service.persistence;

import com.crossriver.crgis.database.model.Documents;

import com.liferay.portal.service.persistence.BasePersistence;

/**
 * The persistence interface for the documents service.
 *
 * <p>
 * Never modify or reference this interface directly. Always use {@link DocumentsUtil} to access the documents persistence. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this interface.
 * </p>
 *
 * <p>
 * Caching information and settings can be found in <code>portal.properties</code>
 * </p>
 *
 * @author Wole Adetiba
 * @see DocumentsPersistenceImpl
 * @see DocumentsUtil
 * @generated
 */
public interface DocumentsPersistence extends BasePersistence<Documents> {
	/**
	* Caches the documents in the entity cache if it is enabled.
	*
	* @param documents the documents to cache
	*/
	public void cacheResult(
		com.crossriver.crgis.database.model.Documents documents);

	/**
	* Caches the documentses in the entity cache if it is enabled.
	*
	* @param documentses the documentses to cache
	*/
	public void cacheResult(
		java.util.List<com.crossriver.crgis.database.model.Documents> documentses);

	/**
	* Creates a new documents with the primary key. Does not add the documents to the database.
	*
	* @param documentId the primary key for the new documents
	* @return the new documents
	*/
	public com.crossriver.crgis.database.model.Documents create(
		java.lang.String documentId);

	/**
	* Removes the documents with the primary key from the database. Also notifies the appropriate model listeners.
	*
	* @param documentId the primary key of the documents to remove
	* @return the documents that was removed
	* @throws com.crossriver.crgis.database.NoSuchDocumentsException if a documents with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.crossriver.crgis.database.model.Documents remove(
		java.lang.String documentId)
		throws com.crossriver.crgis.database.NoSuchDocumentsException,
			com.liferay.portal.kernel.exception.SystemException;

	public com.crossriver.crgis.database.model.Documents updateImpl(
		com.crossriver.crgis.database.model.Documents documents, boolean merge)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Finds the documents with the primary key or throws a {@link com.crossriver.crgis.database.NoSuchDocumentsException} if it could not be found.
	*
	* @param documentId the primary key of the documents to find
	* @return the documents
	* @throws com.crossriver.crgis.database.NoSuchDocumentsException if a documents with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.crossriver.crgis.database.model.Documents findByPrimaryKey(
		java.lang.String documentId)
		throws com.crossriver.crgis.database.NoSuchDocumentsException,
			com.liferay.portal.kernel.exception.SystemException;

	/**
	* Finds the documents with the primary key or returns <code>null</code> if it could not be found.
	*
	* @param documentId the primary key of the documents to find
	* @return the documents, or <code>null</code> if a documents with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.crossriver.crgis.database.model.Documents fetchByPrimaryKey(
		java.lang.String documentId)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Finds all the documentses where userId = &#63;.
	*
	* @param userId the user id to search with
	* @return the matching documentses
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.crossriver.crgis.database.model.Documents> findByUserId(
		java.lang.String userId)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Finds a range of all the documentses where userId = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param userId the user id to search with
	* @param start the lower bound of the range of documentses to return
	* @param end the upper bound of the range of documentses to return (not inclusive)
	* @return the range of matching documentses
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.crossriver.crgis.database.model.Documents> findByUserId(
		java.lang.String userId, int start, int end)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Finds an ordered range of all the documentses where userId = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param userId the user id to search with
	* @param start the lower bound of the range of documentses to return
	* @param end the upper bound of the range of documentses to return (not inclusive)
	* @param orderByComparator the comparator to order the results by
	* @return the ordered range of matching documentses
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.crossriver.crgis.database.model.Documents> findByUserId(
		java.lang.String userId, int start, int end,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Finds the first documents in the ordered set where userId = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param userId the user id to search with
	* @param orderByComparator the comparator to order the set by
	* @return the first matching documents
	* @throws com.crossriver.crgis.database.NoSuchDocumentsException if a matching documents could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.crossriver.crgis.database.model.Documents findByUserId_First(
		java.lang.String userId,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.crossriver.crgis.database.NoSuchDocumentsException,
			com.liferay.portal.kernel.exception.SystemException;

	/**
	* Finds the last documents in the ordered set where userId = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param userId the user id to search with
	* @param orderByComparator the comparator to order the set by
	* @return the last matching documents
	* @throws com.crossriver.crgis.database.NoSuchDocumentsException if a matching documents could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.crossriver.crgis.database.model.Documents findByUserId_Last(
		java.lang.String userId,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.crossriver.crgis.database.NoSuchDocumentsException,
			com.liferay.portal.kernel.exception.SystemException;

	/**
	* Finds the documentses before and after the current documents in the ordered set where userId = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param documentId the primary key of the current documents
	* @param userId the user id to search with
	* @param orderByComparator the comparator to order the set by
	* @return the previous, current, and next documents
	* @throws com.crossriver.crgis.database.NoSuchDocumentsException if a documents with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.crossriver.crgis.database.model.Documents[] findByUserId_PrevAndNext(
		java.lang.String documentId, java.lang.String userId,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.crossriver.crgis.database.NoSuchDocumentsException,
			com.liferay.portal.kernel.exception.SystemException;

	/**
	* Finds all the documentses where applicationId = &#63;.
	*
	* @param applicationId the application id to search with
	* @return the matching documentses
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.crossriver.crgis.database.model.Documents> findByApplicationId(
		java.lang.String applicationId)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Finds a range of all the documentses where applicationId = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param applicationId the application id to search with
	* @param start the lower bound of the range of documentses to return
	* @param end the upper bound of the range of documentses to return (not inclusive)
	* @return the range of matching documentses
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.crossriver.crgis.database.model.Documents> findByApplicationId(
		java.lang.String applicationId, int start, int end)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Finds an ordered range of all the documentses where applicationId = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param applicationId the application id to search with
	* @param start the lower bound of the range of documentses to return
	* @param end the upper bound of the range of documentses to return (not inclusive)
	* @param orderByComparator the comparator to order the results by
	* @return the ordered range of matching documentses
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.crossriver.crgis.database.model.Documents> findByApplicationId(
		java.lang.String applicationId, int start, int end,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Finds the first documents in the ordered set where applicationId = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param applicationId the application id to search with
	* @param orderByComparator the comparator to order the set by
	* @return the first matching documents
	* @throws com.crossriver.crgis.database.NoSuchDocumentsException if a matching documents could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.crossriver.crgis.database.model.Documents findByApplicationId_First(
		java.lang.String applicationId,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.crossriver.crgis.database.NoSuchDocumentsException,
			com.liferay.portal.kernel.exception.SystemException;

	/**
	* Finds the last documents in the ordered set where applicationId = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param applicationId the application id to search with
	* @param orderByComparator the comparator to order the set by
	* @return the last matching documents
	* @throws com.crossriver.crgis.database.NoSuchDocumentsException if a matching documents could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.crossriver.crgis.database.model.Documents findByApplicationId_Last(
		java.lang.String applicationId,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.crossriver.crgis.database.NoSuchDocumentsException,
			com.liferay.portal.kernel.exception.SystemException;

	/**
	* Finds the documentses before and after the current documents in the ordered set where applicationId = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param documentId the primary key of the current documents
	* @param applicationId the application id to search with
	* @param orderByComparator the comparator to order the set by
	* @return the previous, current, and next documents
	* @throws com.crossriver.crgis.database.NoSuchDocumentsException if a documents with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.crossriver.crgis.database.model.Documents[] findByApplicationId_PrevAndNext(
		java.lang.String documentId, java.lang.String applicationId,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.crossriver.crgis.database.NoSuchDocumentsException,
			com.liferay.portal.kernel.exception.SystemException;

	/**
	* Finds all the documentses.
	*
	* @return the documentses
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.crossriver.crgis.database.model.Documents> findAll()
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Finds a range of all the documentses.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param start the lower bound of the range of documentses to return
	* @param end the upper bound of the range of documentses to return (not inclusive)
	* @return the range of documentses
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.crossriver.crgis.database.model.Documents> findAll(
		int start, int end)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Finds an ordered range of all the documentses.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param start the lower bound of the range of documentses to return
	* @param end the upper bound of the range of documentses to return (not inclusive)
	* @param orderByComparator the comparator to order the results by
	* @return the ordered range of documentses
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.crossriver.crgis.database.model.Documents> findAll(
		int start, int end,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Removes all the documentses where userId = &#63; from the database.
	*
	* @param userId the user id to search with
	* @throws SystemException if a system exception occurred
	*/
	public void removeByUserId(java.lang.String userId)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Removes all the documentses where applicationId = &#63; from the database.
	*
	* @param applicationId the application id to search with
	* @throws SystemException if a system exception occurred
	*/
	public void removeByApplicationId(java.lang.String applicationId)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Removes all the documentses from the database.
	*
	* @throws SystemException if a system exception occurred
	*/
	public void removeAll()
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Counts all the documentses where userId = &#63;.
	*
	* @param userId the user id to search with
	* @return the number of matching documentses
	* @throws SystemException if a system exception occurred
	*/
	public int countByUserId(java.lang.String userId)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Counts all the documentses where applicationId = &#63;.
	*
	* @param applicationId the application id to search with
	* @return the number of matching documentses
	* @throws SystemException if a system exception occurred
	*/
	public int countByApplicationId(java.lang.String applicationId)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Counts all the documentses.
	*
	* @return the number of documentses
	* @throws SystemException if a system exception occurred
	*/
	public int countAll()
		throws com.liferay.portal.kernel.exception.SystemException;
}